<?php

namespace app\webapi\controller\cms;

use app\webapi\common\BaseController;
use app\webapi\vms\service\cms\SingleService;
use app\webapi\vms\validate\cms\SingleValidate;
use think\App;

/**
 * @单页控制器
 */
class SingleController extends BaseController
{
    /**
     * @var SingleValidate
     */
    protected $validate;

    /**
     * @var SingleService
     */
    protected $service;

    /**
     * @param App $app
     */
    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->validate = new SingleValidate();
        $this->service = new SingleService();
    }

    /**
     * @desc 设置发展历程信息
     * @return \think\response\Json
     * @throws \Exception
     * @author zhaozhiwei
     * @time 2023/12/14-10:51
     */
    public function setHonoraryQualifications()
    {
        $params = $this->validate->goCheck('setHonoraryQualifications');
        $res = $this->service->setHonoraryQualifications($params,$this->website_id);
        return $this->responseSuccess($res);
    }

    /**
     * @desc 获取发展历程信息
     * @return \think\response\Json
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     * @author zhaozhiwei
     * @time 2023/12/14-10:52
     */
    public function getHonoraryQualifications()
    {
        $params = $this->validate->goCheck('getHonoraryQualifications');
        $res = $this->service->getHonoraryQualifications($params['channel_id'],$this->website_id);
        return $this->responseSuccess($res);
    }

    /**
     * @desc 设置联系我们信息
     * @return \think\response\Json
     * @author zhaozhiwei
     * @time 2023/12/14-10:52
     */
    public function setContactUs()
    {
        $params = $this->validate->goCheck('setContactUs');
        $res = $this->service->setContactUs($params,$this->website_id);
        return $this->responseSuccess($res);
    }

    /**
     * @desc 获取联系我们信息
     * @return \think\response\Json
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     * @author zhaozhiwei
     * @time 2023/12/14-11:18
     */
    public function getContactUs()
    {
        $params = $this->validate->goCheck('getContactUs');
        $res = $this->service->getContactUs($params['channel_id'],$this->website_id);
        return $this->responseSuccess($res);
    }

}